import { getRowByField } from "@/hy_dev_lib/src";
import { Input } from "antd";
import { formItemList, IFormItemConfig } from "../type";

const { TextArea } = Input

// 获取表单项渲染元素
export const getRenderComponent = (formItemConfig: IFormItemConfig) => {
    const { type } = formItemConfig;
    // TextArea
    if (type === "Input" && formItemConfig.maxRows && formItemConfig.maxRows > 1)
        return TextArea;

    return getRowByField(formItemList, type, "type")?.Component;
};
